// Copyright 2012 Dorival de Moraes Pedroso. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// +build ignore

package main

import (
    "fmt"
    "code.google.com/p/gemlab"
)

func main() {
    rg := gemlab.Uregions{
        []int{-1, -2},      // region tags
        []float64{-1, 0.2}, // region max_area
        []int{              // segments' tags
            -10, -11, -12, -13, 0,0,0,0,0,0,
        },
        [][]float64{        // region indicators
            {0.2, 0.2},     // x,y-values
            {0.2, 0.8},     // x,y-values
        },
        [][]float64{    // holes
            {0.7, 0.7}, // x,y-values
        },
        [][]float64{    // points
            {0.0, 0.0}, // x,y-values
            {1.5, 0.0},
            {1.5, 1.5},
            {0.0, 1.5},
            {0.5, 0.5},
            {1.0, 0.5},
            {1.0, 1.0},
            {0.5, 1.0},
            {0.0, 0.75},
            {0.5, 0.75},
            {1.0, 0.75},
            {1.5, 0.75},
        },
        [][]int{ // segments
            { 0,  1},
            { 1,  2},
            { 2,  3},
            { 3,  0},
            { 4,  5},
            { 5,  6},
            { 6,  7},
            { 7,  4},
            { 8,  9},
            {10, 11},
        },
    }
    le := gemlab.Lregions{
        []int{-4}, // rtags
        []int{-5}, // jtags
        []int{ 1}, // quads
        [][]float64{     // points
            {0.0, 0.0}, // x,y-values
            {0.5, 1.5},
        },
        [][]int{ // connectivity
            {0, 1},
        },
        [][]int{ // boundary tags
            {-6, -66}, // left, right
        },
    }
    quad := false
    gmax := -1.0
    err  := gemlab.UmeshGen("t_umesh02", quad, gmax, &rg, &le)
    if err != nil {
        fmt.Printf("%v\n", err.Error())
    }
}
